package org.istt.service;

import java.util.List;

import org.istt.domain.AttachFile;
import org.istt.domain.Category;
import org.istt.domain.CategoryType;

public interface AttachFileManager {
    public List<AttachFile> getAttachFiles();
    public AttachFile getAttachFile(String attachFileId);
    public void saveAttachFile(AttachFile attachFile);
    public void removeAttachFile(String attachFileId);
    public List<AttachFile> searchAttachFile(Category categoryId, String attachFileName, CategoryType categoryType);
    
    /**
     * Find all the attach file belong to a category
     * @param cateId Category ID
     * @return the list of attach file
     */
    List<AttachFile> searchByCateId(Long cateId);

    List<AttachFile> findAttachFileByCate(Long categoryId, Long categoryTypeId);
    
    /**
     * 
     * @param categoryId
     * @param categoryTypeId
     * @return
     */
    List<AttachFile> getByCatIdAndCatTypeId(Long categoryId, Long categoryTypeId);
    boolean isUnique(String[] fields, String[] value, Long id, Long cateId, Long cateTypeId, Long docTypeId);
    
    /**
     * Dem so luong file ma ho so dang dinh kem
     * @param attachFileId
     * @return
     */
    int countFileUseAttach(Long attachFileId);

    int countAttachFile(Long cateId, Long cateTypeId, Long docTypeId);
    
    
}
